package com.tagtraum.perf.gcviewer;

import java.awt.CardLayout;
import java.awt.Container;

public class SectionSwitcher
  implements SectionChangeListener
{
  private final CardLayout layout;
  private final Container container;

  public SectionSwitcher(Container container)
  {
    this.layout = ((CardLayout)container.getLayout());
    this.container = container;
  }

  public void onChange(Object origin, String section)
  {
    this.layout.show(this.container, section);
    //System.out.println(section);
  }
}